Specifications for DocView Integration with External Databases. ----------------------------------------------------------------------- Informatik Inc. has available several utilities for special requirements, such as direct printing, scanning, batch conversions, image clipping, etc. If you are looking for special functions that are not included in DocView, please contact Informatik Inc. ------------------------------------------------------------------------ OVERVIEW DocView supports many methods of viewing images: 1. Stand-alone viewing Start-up DocView and open the images from the File menu. 2. From the File Manager, Explorer Associate the image file extension with DocView, then double-click on the file name and DocView will start up and display the image file. Normally, a new instance of DocView is created each time you select a file. However, with the RUNDDE.EXE utility (see below) you can maintain a SINGLE INSTANCE. 3. From the Internet Browser In the web browser, associate the image file extension with DocView, then click on the hyper-text file name on the web page (TIFF files) and DocView will start up and display the image file. Normally, a new instance of DocView is created each time you select a file. However, with the RUNDDE.EXE utility (see below) you can maintain a SINGLE INSTANCE. 4. From another application DocView can be integrated into virtually any application. The preferred method is DDE Poke. If DDE is not (easily) supported by the controlling application, then the RUNDDE.EXE utility (see below) will handle the integration with a simple EXECUTE call. A single image file or a list of files can be 'passed' to DocView. If a list of files is passed to DocView, the individual files can be browsed in DocView just like pages of a multi-page document. ------------------------------------------------------------------------- QUICK DEMO For a quick demo of a simple integration, type the following text in the Run box of the Program Manager, File Manager (in Windows 95 click on Start and choose Run): c:\docview\docview.exe c:\mydir\images\img0001.tif, My First Image where: c:\docview\docview.exe is the path to the DocView executable, c:\images\img0001.tif is the path to the image file, and 'My First Image' is the optional caption of the display window. Press OK and the image will be displayed in DocView. If the third parameter is omitted, DocView will show the image file name in the title bar (caption). ------------------------------------------------------------------------- INTEGRATION The following setup is required to integrate the external database with DocView: The setup is done via the Setup menu. The recommended interface is with DDE (Dynamic Data Interchange). If your database application does not support DDE (or if DDE does not seem to respond), the interface can be accomplished with the RUNDDE.EXE utility. For details on the RUNDDE and SendKeys methods, please read the sections below. THE RUNDDE.EXE UTILITY A QUICK METHOD TO CREATE THE INTEGRATION The quickest way to effectuate a working integration (one-way from your master application to DocView) is as follows: Make sure that the following files (among many other files) are in the DOCVIEW directory: - DOCVIEW.EXE - RUNDDE.EXE - RUNDDE.INI Verify that the RUNDDE.INI file contains the following text: [Setup] App=Docview EXEFile=c:\docview\docview.exe Timeout=100 In your master application, 'attach' the following code to an event, e.g. a button-click event: param = "C:\MyDir\img001.tif" '------ specify the image file name x = shell("C:\docview\rundde.exe " & param,3) '----- space after the exe !!!' Typically, the image file name will be extracted from a field in the master application's window. If so, your 'param' code above would be as follows: param = [TheField] where TheField would be the name of the field that holds the image file name (with path). With this method, you do not need to worry about DDE; the RUNDDE.EXE converts the command to a DDE command that is compatible with DocView. There may be some (almost unnoticeable) response penalty for this convenience. -------------------------------------------------------------------- THE PARAMETER STRING The Parameter String is the specification you add to the EXECUTE command. For example, in the launch command X=Shell("C:\DOCVIEW\DOCVIEW.EXE C:\IMAGES\IMG0001.TIF the C:\IMAGES\IMG0001.TIF is the parameter string. Normally, the parameter string consists of the image file name that you want to display. The parameter can also include the title and the page number. Furthermore, the parameter can consist of several image files. For more detail, read the sections below. Examples: C:\IMAGES\IMG0001.TIF,Exhibit C:\IMAGES\IMG0001.TIF page=15,Exhibit 15 The parameter string can also be one of the following keywords not case sensitive): cmd-new cmd=close imagefile imagefile2 The 'cmd=new' command will open a new (empty) image window. This function is useful if you do not want the new image to replace the previous image. The 'cmd=close' command will terminate DocView. The imagefile and imagefile2 will allow you to send a batch of image files to DocView. Please read the section below. For example, X=Shell("C:\DOCVIEW\DOCVIEW.EXE cmd=close will close DocView ----------------------------------------------------------------------------- DDE (DYNAMIC DATA INTERCHANGE) A MORE ADVANCED DDE LINK You can write the DDE code directly into the master application. This is the most efficient and recommended method. You need some knowledge of DDE coding, but you can use the examples given below as 'starter' templates. The DDE elements are as follows: Application = Docview Topic = Linkform Item = Linkbox If you have any questions, please contact Informatik Inc. The email address and telephone number are shown at the bottom of this text file. EXAMPLE OF A CODE IN THE MS ACCESS APPLICATION: ----------------------------------------------- Sub TheButton_Click() 'executed when the user clicks on the TheButton. Dim Chan Dim x Dim param On error resume next param = [TheField] Chan = DDEInitiate("Docview","Linkform") ' Establish a DDE link if err <> 0 then ' if DocView is not yet running ..... x = shell("C:\docview\docview.exe " & param,3) 'start up Docview. (Space after 'exe'!) else DDEPoke Chan, "Linkbox", param 'Poke the data to DocView DDETerminateAll 'Close the DDE link endif End Sub (Where param represents the parameter sent to DocView.) EXAMPLE OF A CODE IN AN VISUAL BASIC APPLICATION ------------------------------------------------ Sub Command1_Click () On Error Resume Next ddelink.LinkMode = 0 ddelink.LinkTopic = "Docview|Linkform" ddelink.LinkItem = "Linkbox" ddelink.LinkMode = 2 If Err = 282 Then dummy = Shell("c:\docview\install\docview.exe ddddddd", 1) else ddelink.Caption = ddddddd ddelink.LinkPoke ddelink.LinkMode = 0 endif End Sub (Where ddddddd represents the parameter sent to DocView.) EXAMPLE OF PARADOX CODE ----------------------- (partial coding) var ddevar dde filevar string endvar filevar = "C:\mydir\img0001.tif" ddevar.open("DocView", "Linkform", "Linkbox") ddevar=filevar EXAMPLE OF FOXPRO CODE ---------------------- (partial coding) img = "C:\xxx\img001.tif" chan = ddeinitiate("DOCVIEW" , "Linkform") (Here, code must check for errors. If the DDE chan could not be opened, the program should launch DocView, else it should proceed with the following function) x=DDEPoke(chan, "Linkbox", imagefile) (DocView, Linkform and Linkbox are keywords; use them as they are). Please refer to the database application's user guide for the DDE syntax. ---------------------------------------------------------------------------- MORE ABOUT THE PARAMETER STRING As indicated above, in most cases the parameter consists simply of the file name of the image that you want to display (with path and extension). For more advanced use, the parameter can be expanded. The parameter is a single line string, such as ffffffff,ttttttttt where fffffff is the file name (with path and extension), and ttttttt is the optional title (description) of the image. The title, if used, will be displayed in the title bar of the image. To open a specific page of a file, use the following syntax: ffffffff page=n,tttttttt (where n is the page number) For a method of passing a batch of files, please read the section on Multi-Page Functions below. ------------------------------------------------------------------------------ BATCHES, MULTI-PAGE FUNCTIONS DocView supports multi-page TIF and DCX files. When a multi-page file is opened, DocView reveals the page navigation buttons in the tool bar (such as next, fast forward, last, etc.). DocView can also emulate multi-page displays with single-page files. If your imaging system uses separate files for each page of a document, the file make-up of a document can be passed to DocView, and DocView can display the files as if they were a multi-page file. Essentially, in the controlling application, you copy the file names to the Windows Clipboard or save it as a IMGFILE.TXT file in DocView's directory (each file separated by a comma or a hard return) and you fire the DDE command with the 'imagefile' keyword, if you use The Clipboard method, or 'imagefile2' keyword, if you use the IMGFILE.TXT method. For example, you would send a batch of files (listed in the IMGFILE.TXT file) to DocView as follows: X=Shell("C:\DOCVIEW\DOCVIEW.EXE imagefile2 The IMGFILE.TXT might contain the following text: c:\images\img0001.tif,c:\images\img0003.tif,c:\images\img0015.tif ----------------------------------------------------------------------- SYSTEM SETUP If your interface is ONE-WAY, i.e. only from your database application to DocView (no interface from DocView back to the database), then you can ignore the next several paragraphs. To create a link FROM DocView TO your database application, choose the Setup menu, click on Advanced button, and make the entries as explained in the examples below: Example of a SETUP (for MSACCESS 2.0 DATABASE) -------------------------------------------------------- Database Editing Sub-System: (only required for sending data FROM DocView TO the master application) DDE Topic: MSAccess|EditForm DDE Item: TheField SendKeys String: ====leave this line blank---- Items 1-3 contain information about the external database's EDITING subsystem: Item 1 is the DDE TOPIC (in the MS Access database system). Item 2 is DDE ITEM (in the MS Access database system). Item 3 (leave this line blank) Database Query Sub-System: (only required for sending data FROM DocView TO the master application) DDE Topic: MSAccess|QueryForm DDE Item: TheField SendKeys String: ====leave this line blank==== Items 4-6 contain information about the external database's QUERY subsystem: Item 4 is the DDE TOPIC (in the MS Access database system). Item 5 is DDE ITEM (in the MS Access database system). Item 6 (leave this line blank) ---------------------------------------------------------------------- DEFAULT SETTINGS Various default settings can be specified in the Setup menu (or directly in the DOCVIEW.INI file). Optional Fixed Path: Example: D:\DOCS specifies the fixed path name of the directory that holds the image files. This is required only if the image address in the database does not include the directory name. Path Substitution: Example: D: specifies the path substitution. An equal number of leading letters of the path passed by the DDE parameter will be substituted. To specify the number of characters to be replaced, add the number after a space, for example C:\AAA 9 Master Window: Example: 0 specifies the opening state of the parent (MDI) window: blank or 0 = normal, full screen size 1 = minimized 2 = maximized 3 = Fit-to-image, upper-left corner x=nnnn y=nnnn will offset the window from the left and the top by the nnnn values, e.g x=1440 y = 720 will place the window 1 inch from the left and 0.5 inches from the top. The window is sized to fit the image. x=right y=bottom will place the window at the absolute right and/or bottom of the screen. Image Windows Width: Example: 75 specifies the width of the image display window. If the value is 2, the window opens maximized, otherwise, if the value is 100 or less, the entry represents a percentage of the screen width. If more than 100 it represents the measurement in twips (1440 twips = 1 inch; 576 twips = 1 cm). Image Windows Height: Example: 95 specifies the height of the image display window. If the value is 100 or less, the entry represents a percentage of the available screen height, otherwise it is measured in twips (1440 twips = 1 inch; 576 twips = 1 cm). Magnification List Example: 25,50,100,150,200,300 represents the list of magnification ratios that you want to see in the Magnification menu. Options: represents other options: nosave = the Save As option in the image windows is suppressed. nopaint = the Paint options are disabled. noopen = the Open File options are disabled. nosetup = the Setup option is disabled. You need to 'undo' this flag by editing the INI file. printall = the default is set to print ALL pages. noprint = disables the printing functions fit = opens the image 'sized-to-fit' scrolllock, scrolllockv, scrolllockh = locks the scroll position (both, vertical, horizontal). When opening another image file, the system keeps the previous scroll position. When changing pages, however, the scroll position is reset to base zero. If you use several options, separate the options with a comma or a space. Print Offset: specifies the left and top margin for the purpose of printing (inches or centimeters depending on the Windows setup) Sending data from DocView to the database application ----------------------------------------------------- When the user clicks on the Edit button (pencil) or the Query button (question marks) in the toolbar of DocView, DocView pokes the file name of the currently displayed image to the database application. The information is sent to the form and field specified in the setup (items 1,2 and 4,5, see SYSTEM SETUP above). In the database application, you need to write the appropriate code to handle the poked data. (VB Programmers please note: The 'receiving' form must have the linkmode set to 1 and the linktopic must agree with the topic specified in the setup.) -------------------------------------------------------------------------------- **************************************************************** **************************************************************** You can also interface DocView with the SendKeys method. If you need information on this method, please contact Informatik Inc. and ask for the SENDKEYS.TXT file. DDE is much superior to the SendKeys method, but there may be situations where only the SendKeys method will work. **************************************************************** **************************************************************** For support, contact Informatik Inc. at 610.640.0339 or support@informatik.com. Also, visit www.informatik.com/news.html for update announcements.